Introduction

Our research focuses on performing Exploratory Data Analysis (EDA) on Google Play Store apps to uncover patterns, trends, and insights regarding app characteristics, user behavior, and installation patterns. We are trying to see how app popularity, defined as the number of installs with high reviews and ratings, is impacted by categories, last updated, app sizes, version, and other factors.

Smart Question

“What is the impact of content rating, required Android version, app category, size, and pricing on predicting app success in terms of positive ratings and high user reviews, as well as the number of installs, using data from Google Play Store apps from 2010 to 2018?”

Specific: The question clearly defines the variables (content rating, required Android version, app category, size, pricing) and the outcomes (positive ratings, high user reviews, number of installs).

Measurable: The outcomes (positive ratings, high user reviews, number of installs) are quantifiable.

Achievable: Given the availability of Google Play Store data from 2010 to 2018, the analysis is feasible.

Relevant: The question addresses a significant issue in the app development and marketing industry: predicting app success.

Time-specific: The timeframe (2010-2018) is clearly defined.

Loading Dataset and reviewing Structure of Data

Here, we have loaded the dataset ‘Google Play Store Apps’ stored in csv file using ()

Loading Data set

#Loading the Dataset
data_apps <- data.frame(read.csv("googleplaystore.csv"))

Structure of Data

#Checking the structure of the data
str(data_apps)
## 'data.frame':    10841 obs. of  13 variables:
##  $ App           : chr  "Photo Editor & Candy Camera & Grid & ScrapBook" "Coloring book moana" "U Launcher Lite – FREE Live Cool Themes, Hide Apps" "Sketch - Draw & Paint" ...
##  $ Category      : chr  "ART_AND_DESIGN" "ART_AND_DESIGN" "ART_AND_DESIGN" "ART_AND_DESIGN" ...
##  $ Rating        : num  4.1 3.9 4.7 4.5 4.3 4.4 3.8 4.1 4.4 4.7 ...
##  $ Reviews       : chr  "159" "967" "87510" "215644" ...
##  $ Size          : chr  "19M" "14M" "8.7M" "25M" ...
##  $ Installs      : chr  "10,000+" "500,000+" "5,000,000+" "50,000,000+" ...
##  $ Type          : chr  "Free" "Free" "Free" "Free" ...
##  $ Price         : chr  "0" "0" "0" "0" ...
##  $ Content.Rating: chr  "Everyone" "Everyone" "Everyone" "Teen" ...
##  $ Genres        : chr  "Art & Design" "Art & Design;Pretend Play" "Art & Design" "Art & Design" ...
##  $ Last.Updated  : chr  "January 7, 2018" "January 15, 2018" "August 1, 2018" "June 8, 2018" ...
##  $ Current.Ver   : chr  "1.0.0" "2.0.0" "1.2.4" "Varies with device" ...
##  $ Android.Ver   : chr  "4.0.3 and up" "4.0.3 and up" "4.0.3 and up" "4.2 and up" ...
#First 5 rows of the dataset
head(data_apps)
##                                                  App       Category Rating
## 1     Photo Editor & Candy Camera & Grid & ScrapBook ART_AND_DESIGN    4.1
## 2                                Coloring book moana ART_AND_DESIGN    3.9
## 3 U Launcher Lite – FREE Live Cool Themes, Hide Apps ART_AND_DESIGN    4.7
## 4                              Sketch - Draw & Paint ART_AND_DESIGN    4.5
## 5              Pixel Draw - Number Art Coloring Book ART_AND_DESIGN    4.3
## 6                         Paper flowers instructions ART_AND_DESIGN    4.4
##   Reviews Size    Installs Type Price Content.Rating                    Genres
## 1     159  19M     10,000+ Free     0       Everyone              Art & Design
## 2     967  14M    500,000+ Free     0       Everyone Art & Design;Pretend Play
## 3   87510 8.7M  5,000,000+ Free     0       Everyone              Art & Design
## 4  215644  25M 50,000,000+ Free     0           Teen              Art & Design
## 5     967 2.8M    100,000+ Free     0       Everyone   Art & Design;Creativity
## 6     167 5.6M     50,000+ Free     0       Everyone              Art & Design
##       Last.Updated        Current.Ver  Android.Ver
## 1  January 7, 2018              1.0.0 4.0.3 and up
## 2 January 15, 2018              2.0.0 4.0.3 and up
## 3   August 1, 2018              1.2.4 4.0.3 and up
## 4     June 8, 2018 Varies with device   4.2 and up
## 5    June 20, 2018                1.1   4.4 and up
## 6   March 26, 2017                1.0   2.3 and up

Description of the App Dataset Columns

  1. App: The name of the application, represented as a character string.
  2. Category: The main category of the app, such as “ART_AND_DESIGN,” represented as a character string.
  3. Rating: The average user rating of the app, recorded as a numeric value.
  4. Reviews: The total number of user reviews for the app, shown as a character string.
  5. Size: The size of the application, represented as a character string.
  6. Installs: The approximate number of installations for the app, stored as a character string.
  7. Type: Indicates whether the app is free or paid, represented as a character string.
  8. Price: The price of the app, stored as a character string. Free apps are listed as “0,” while paid apps have a dollar amount.
  9. Content.Rating: The target age group for the app, represented as a character string.
  10. Genres: The genre(s) of the app.
  11. Last.Updated: The date of the app’s last update, stored as a character string.
  12. Current.Ver: The current version of the app, represented as a character string.
  13. Android.Ver: The minimum Android version required to run the app, stored as a character string.

Data Cleaning

Checking the Duplicates

Checking and Removing for duplicated apps and removing

#Display all the duplicated Apps
duplicate_apps <- aggregate(App ~ ., data = data_apps, FUN = length)  
duplicate_apps <- duplicate_apps[duplicate_apps$App > 1, ] 
duplicate_apps <- duplicate_apps[order(-duplicate_apps$App), ] 

#View(duplicate_apps)
#print(duplicate_apps)

print(paste("Number of duplicated Apps:",nrow(duplicate_apps)))
## [1] "Number of duplicated Apps: 404"
#Removing Na values and duplicates
data_final <- data_apps[!is.na(data_apps$App), ] 
data_final <- data_final[!duplicated(data_final$App), ] 

#(After removing the duplicates) Unique values
unique_apps <- length(unique(data_final$App))
print(paste("Number of unique apps after removing the duplicates:", unique_apps))
## [1] "Number of unique apps after removing the duplicates: 9660"
#Verifying the structure of the App column
str(data_final$App)
##  chr [1:9660] "Photo Editor & Candy Camera & Grid & ScrapBook" ...

Duplicate App Analysis:

  • 404 apps were repeated either twice or thrice.
  • After removing duplicates, the dataset now contains 9660 unique apps.
  • Total duplicates removed: 1181 apps.

It is not appropriate to check for duplicates of other columns as there are numrerical and categorical variables, and in above duplicate rows are removed

Checking and changing Datatype

Checking datatype of Features

typeof(data_apps$App)
## [1] "character"
typeof(data_apps$Price)
## [1] "character"
typeof(data_apps$Size)
## [1] "character"
typeof(data_apps$Rating)
## [1] "double"
typeof(data_apps$Reviews)
## [1] "character"
typeof(data_apps$Category)
## [1] "character"
typeof(data_apps$Type)
## [1] "character"

As seen the variables, which needed to be converted from character are Price,Reviews,Size into integers.

Formating Columns and converting to numeric for appropriate variables

##Price Conversion
# Remove dollar symbols and convert to numeric
data_final$Price <- as.numeric(gsub("\\$", "", data_final$Price))



#Size Converison
# Replace "Varies with Device" in the Size column with NA
data_final$Size[data_final$Size == "Varies with device"] <- NA
data_final <- data_final[!grepl("\\+", data_final$Size), ]
data_final$Size <- ifelse(grepl("k", data_final$Size),
                          as.numeric(gsub("k", "", data_final$Size)) *
0.001,  # Convert "K" to MB
                          as.numeric(gsub("M", "", data_final$Size)))
# Remove "M" for megabytes


#Installs Conversion
clean_installs <- function(Installs) {
  Installs <- gsub("\\+", "", Installs)  
  Installs <- gsub(",", "", Installs)    
  return(as.numeric(Installs))           
}
data_final$Installs <- sapply(data_final$Installs, clean_installs)
nan_rows <- sapply(data_final[, c("Size", "Installs")], function(x) any(is.nan(x)))
# Display only rows that contain NaN in either Size or Installs
data_final[,nan_rows]
## data frame with 0 columns and 9659 rows
datatable((data_final), options = list(scrollX = TRUE ))
# Identify the unique values in the 'Installs' column
unique_values <- unique(data_final$Installs)
# Function to convert the installs to numeric
convert_to_numeric <- function(x) {
  # Remove non-numeric characters and convert to numeric
  as.numeric(gsub("[^0-9]", "", x)) * 10^(length(gregexpr(",", x)[[1]]) - 1)
}
# Sort unique values based on the custom numeric conversion
sorted_values <- unique_values[order(sapply(unique_values, convert_to_numeric))]
# Convert sorted values to character without scientific notation
formatted_values <- format(sorted_values, scientific = FALSE, trim = TRUE)
# Update the original 'Installs' column in data_final based on the numeric conversion
data_final$Installs <- format(data_final$Installs, scientific = FALSE, trim = TRUE)
data_final$Installs <- as.numeric(data_final$Installs)

# Review Conversion
data_final$Reviews <- as.numeric(data_final$Reviews)

#Content Rating 
# Remove leading and trailing spaces and convert all text to a consistent format 
data_final$Content.Rating <- trimws(tolower(data_final$Content.Rating))

#Date Formatting for Last Updated
# Convert Last Updated to Date format
data_final$Last.Updated <- as.Date(data_final$Last.Updated, format = "%Y-%m-%d")

#Verifying the Data structure again
str(data_final)
## 'data.frame':    9659 obs. of  13 variables:
##  $ App           : chr  "Photo Editor & Candy Camera & Grid & ScrapBook" "Coloring book moana" "U Launcher Lite – FREE Live Cool Themes, Hide Apps" "Sketch - Draw & Paint" ...
##  $ Category      : chr  "ART_AND_DESIGN" "ART_AND_DESIGN" "ART_AND_DESIGN" "ART_AND_DESIGN" ...
##  $ Rating        : num  4.1 3.9 4.7 4.5 4.3 4.4 3.8 4.1 4.4 4.7 ...
##  $ Reviews       : num  159 967 87510 215644 967 ...
##  $ Size          : num  19 14 8.7 25 2.8 5.6 19 29 33 3.1 ...
##  $ Installs      : num  1e+04 5e+05 5e+06 5e+07 1e+05 5e+04 5e+04 1e+06 1e+06 1e+04 ...
##  $ Type          : chr  "Free" "Free" "Free" "Free" ...
##  $ Price         : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Content.Rating: chr  "everyone" "everyone" "everyone" "teen" ...
##  $ Genres        : chr  "Art & Design" "Art & Design;Pretend Play" "Art & Design" "Art & Design" ...
##  $ Last.Updated  : Date, format: NA NA ...
##  $ Current.Ver   : chr  "1.0.0" "2.0.0" "1.2.4" "Varies with device" ...
##  $ Android.Ver   : chr  "4.0.3 and up" "4.0.3 and up" "4.0.3 and up" "4.2 and up" ...

All the $ symbols in Price column, ‘+’ sign in Installs are removed, size is converted from KB, MB to numeric values by adding zeroes

Checking unique values and factoring them for Categorical Variables and removing unecessary columns

# Checking the type of the Category 

length(unique(data_final$Category))
## [1] 33
length(unique(data_final$Genres))
## [1] 118
data_final <- data_final
data_final$Category <- factor(data_final$Category)
data_final$Android.Ver <- factor(data_final$Android.Ver)
data_final <- data_final %>% select(-c('Genres', 'Current.Ver'))


xkablesummary(data_final)
Table: Statistics summary.
App Category Rating Reviews Size Installs Type Price Content.Rating Last.Updated Android.Ver
Min Length:9659 FAMILY :1832 Min. :1.000 Min. : 0 Min. : 0.0085 Min. :0.000e+00 Length:9659 Min. : 0.000 Length:9659 Min. :NA 4.1 and up :2202
Q1 Class :character GAME : 959 1st Qu.:4.000 1st Qu.: 25 1st Qu.: 4.6000 1st Qu.:1.000e+03 Class :character 1st Qu.: 0.000 Class :character 1st Qu.:NA 4.0.3 and up :1395
Median Mode :character TOOLS : 827 Median :4.300 Median : 967 Median : 12.0000 Median :1.000e+05 Mode :character Median : 0.000 Mode :character Median :NA 4.0 and up :1285
Mean NA BUSINESS : 420 Mean :4.173 Mean : 216593 Mean : 20.3953 Mean :7.778e+06 NA Mean : 1.099 NA Mean :NaN Varies with device: 990
Q3 NA MEDICAL : 395 3rd Qu.:4.500 3rd Qu.: 29401 3rd Qu.: 28.0000 3rd Qu.:1.000e+06 NA 3rd Qu.: 0.000 NA 3rd Qu.:NA 4.4 and up : 818
Max NA PERSONALIZATION: 376 Max. :5.000 Max. :78158306 Max. :100.0000 Max. :1.000e+09 NA Max. :400.000 NA Max. :NA 2.3 and up : 616
NA NA (Other) :4850 NA’s :1463 NA NA’s :1227 NA NA NA NA NA’s :9659 (Other) :2353

There are 33 categories in the the data frame with 118 genres. This means that in each category, there are multiple genres. Given that, the later analyses in this project can be proceeded with Category variable.

Due to the inconsistent formatting of values in the Current.Vercolumn, and genre column which is same as Category column, these columns will be dropped and excluded from the analysis.

Handling missing values

#Missing values in Price 
missing_na <- is.na(data_final$Price)    
missing_blank <- data_final$Price == "" 
sum(missing_na)
## [1] 0
sum(missing_blank, na.rm = TRUE)
## [1] 0
# Remove row where Price is NA or blank
data_final <- data_final[!is.na(data_final$Price) & data_final$Price != "", ]


#Checking the type of Type variable
table(data_final$Type)
## 
## Free Paid 
## 8902  756
#Checking for Missing values
print(paste("Missing values:",sum(is.na(data_final$Type))))
## [1] "Missing values: 0"
data_final[is.na(data_final$Type), ]
##  [1] App            Category       Rating         Reviews        Size          
##  [6] Installs       Type           Price          Content.Rating Last.Updated  
## [11] Android.Ver   
## <0 rows> (or 0-length row.names)
#Checking for Size variable
# Calculate and display the mean size for each category in the 'Type' column
mean_size_by_type <- tapply(data_final$Size, data_final$Category,
mean, na.rm = TRUE)
print(mean_size_by_type)
##      ART_AND_DESIGN   AUTO_AND_VEHICLES              BEAUTY BOOKS_AND_REFERENCE 
##           12.370968           20.037147           13.795745           13.134701 
##            BUSINESS              COMICS       COMMUNICATION              DATING 
##           13.867194           13.794959           11.307430           15.661119 
##           EDUCATION       ENTERTAINMENT              EVENTS              FAMILY 
##           19.057101           23.043750           13.963754           27.187988 
##             FINANCE      FOOD_AND_DRINK                GAME  HEALTH_AND_FITNESS 
##           17.368127           20.494318           41.866609           20.669707 
##      HOUSE_AND_HOME  LIBRARIES_AND_DEMO           LIFESTYLE MAPS_AND_NAVIGATION 
##           15.970258           10.602883           14.844916           16.368121 
##             MEDICAL  NEWS_AND_MAGAZINES           PARENTING     PERSONALIZATION 
##           19.189399           12.470189           22.512963           11.224624 
##         PHOTOGRAPHY        PRODUCTIVITY            SHOPPING              SOCIAL 
##           15.666158           12.342505           15.491435           15.984090 
##              SPORTS               TOOLS    TRAVEL_AND_LOCAL       VIDEO_PLAYERS 
##           24.058361            8.782837           24.204410           15.792756 
##             WEATHER 
##           12.680036
# Loop through each row and replace NA values in the Size column with the mean size of the corresponding category
data_final$Size <- ifelse(
  is.na(data_final$Size),  # Check if Size is NA
  round(mean_size_by_type[data_final$Category], 1),  # Replace with the mean size based on the Category
  data_final$Size  # Keep the original size if it's not NA
)

#Replace NA in Ratings with Overall Mean
data_final <- data_final %>%
  mutate(Rating = ifelse(is.na(Rating), mean(Rating, na.rm = TRUE), Rating))

#NA values in Content Rating
cr_missing <- sum(is.na(data_final$`Content Rating`))
#Last updated NA values
lu_missing <- sum(is.na(data_final$Last.Updated))

After handling the missing values:

  • Have removed one row #10473 with missing price value which app does not have a category name as it is not relevant to our analysis.

  • For type column, the price 0 is misread as Paid, due to inconsistency changed the variable.

  • For size column the missing values are replaced with mean of size for particular category

  • For Rating column the missing values were replaced with mean of Ratings

  • For Content Rating and Last Updated, there are No missing values

Data Exploring and Visualization

Univariate Analysis

Visualization for Price Distribution

# Count Plot for the Price distribution


ggplot(data_final, aes(x=Price)) +
  geom_histogram(binwidth=2, fill="pink", color="black") +
   xlim(0, 500) + ylim(0, 500) +
  labs(title="Price Distribution", x="Price", y="Frequency") +
  theme_minimal()

The data is highly skewed as there are many zero price entries.

# Boxplot for the same
ggplot(data_final, aes(y=Price)) +
  geom_boxplot(outlier.colour = "red", outlier.shape = 16, outlier.size = 1, fill="pink", color="black") +
  labs(title="Price Boxplot", y="Price") +
  theme_minimal()

Checking outliers for Price

outlierKD2 <- function(df, var, rm = FALSE, boxplt = FALSE, histogram = TRUE, qqplt = FALSE) {
  dt <- df  # Duplicate the dataframe for potential alteration
  var_name <- eval(substitute(var), eval(dt))
  na1 <- sum(is.na(var_name))
  m1 <- mean(var_name, na.rm = TRUE)
  colTotal <- boxplt + histogram + qqplt  # Calculate the total number of charts to be displayed
  par(mfrow = c(2, max(2, colTotal)), oma = c(0, 0, 3, 0))  # Adjust layout for plots
  
  # Q-Q plot with custom title
  if (qqplt) {
    qqnorm(var_name, main="Q-Q plot without Outliers")
    qqline(var_name)
  }
  
  # Histogram with custom title
  if (histogram) { 
    hist(var_name,main = "Histogram without Outliers", xlab = NA, ylab = NA) 
  }
  
  # Box plot with custom title
  if (boxplt) { 
    boxplot(var_name, main= "Box Plot without Outliers")
  }
  
  # Identify outliers
  outlier <- boxplot.stats(var_name)$out
  mo <- mean(outlier)
  var_name <- ifelse(var_name %in% outlier, NA, var_name)
  
  # Q-Q plot without outliers
  if (qqplt) {
    qqnorm(var_name, main="Q-Q plot with Outliers")
    qqline(var_name)
  }
  
  # Histogram without outliers
  if (histogram) { 
    hist(var_name, main = "Histogram with Outliers", xlab = NA, ylab = NA) 
  }
  
  # Box plot without outliers
  if (boxplt) { 
    boxplot(var_name, main = "Boxplot with Outliers") 
  }
  
  # Add the title for the overall plot section if any plots are displayed
  if (colTotal > 0) {
    title("Outlier Check", outer = TRUE)
    na2 <- sum(is.na(var_name))
    cat("Outliers identified:", na2 - na1, "\n")
    cat("Proportion (%) of outliers:", round((na2 - na1) / sum(!is.na(var_name)) * 100, 1), "\n")
    cat("Mean of the outliers:", round(mo, 2), "\n")
    cat("Mean without removing outliers:", round(m1, 2), "\n")
    cat("Mean if we remove outliers:", round(mean(var_name, na.rm = TRUE), 2), "\n")
  }
}
#outlier function is defined in previous chunck of code.
outlier_check_price = outlierKD2(data_final, Price, rm = FALSE, boxplt = TRUE, qqplt = TRUE)

## Outliers identified: 756 
## Proportion (%) of outliers: 8.5 
## Mean of the outliers: 14.05 
## Mean without removing outliers: 1.1 
## Mean if we remove outliers: 0

The price values in the dataset, including both typical and extreme values, are valid observations for our analysis. As such, removing these outliers may not be beneficial for our study.

#To check the value ranges
table(data_final$Price)
## 
##      0   0.99      1   1.04    1.2   1.26   1.29   1.49    1.5   1.59   1.61 
##   8903    145      3      1      1      1      1     46      1      1      1 
##    1.7   1.75   1.76   1.96   1.97   1.99      2   2.49    2.5   2.56   2.59 
##      2      1      1      1      1     73      3     25      1      1      1 
##    2.6    2.9   2.95   2.99   3.02   3.04   3.08   3.28   3.49   3.61   3.88 
##      1      1      1    124      1      1      1      1      7      1      1 
##    3.9   3.95   3.99   4.29   4.49   4.59    4.6   4.77    4.8   4.84   4.85 
##      1      1     57      1      9      1      1      1      1      1      1 
##   4.99      5   5.49   5.99   6.49   6.99   7.49   7.99   8.49   8.99      9 
##     70      1      5     26      5     11      2      7      2      5      1 
##   9.99     10  10.99  11.99  12.99  13.99     14  14.99  15.46  15.99  16.99 
##     19      2      2      3      4      2      1      9      1      1      2 
##  17.99  18.99   19.4   19.9  19.99  24.99  25.99  28.99  29.99  30.99  33.99 
##      2      1      1      1      5      3      1      1      5      1      1 
##  37.99  39.99  46.99  74.99  79.99  89.99 109.99 154.99    200 299.99 379.99 
##      1      2      1      1      1      1      1      1      1      1      1 
## 389.99 394.99 399.99    400 
##      1      1     12      1

As aldready mentioned, there are 8903 free apps (More apps with price as 0).

Visualization for Type Distribution

# Bar Plot for the Type Distribution
ggplot(data_final, aes(x = Type)) +
  geom_bar(fill = "pink", color = "black") +
  labs(title = "Distribution of App Types (Free vs Paid)", x = "Type", y = "Count") +
  theme_minimal()

As it is clear, there are more free apps.

Checking mean price for each type of Pricing

#Display statistics for the Price of apps grouped by their Type
data_final$Type <- as.factor(data_final$Type)


summary_by_type <- data.frame(
  Type = levels(data_final$Type),
  Min_Price = tapply(data_final$Price, data_final$Type, min, na.rm = TRUE),
  Max_Price = tapply(data_final$Price, data_final$Type, max, na.rm = TRUE),
  Mean_Price = tapply(data_final$Price, data_final$Type, mean, na.rm = TRUE),
  Median_Price = tapply(data_final$Price, data_final$Type, median, na.rm = TRUE)
)


print(summary_by_type)
##      Type Min_Price Max_Price Mean_Price Median_Price
## Free Free      0.00         0    0.00000         0.00
## NaN   NaN      0.00         0    0.00000         0.00
## Paid Paid      0.99       400   14.04515         2.99

Distribution for Price by Type

#Scatter plot for price distribution by app type
ggplot(data_final, aes(x = Type, y = Price, fill = Type)) +
  geom_boxplot() +
  labs(title = "Price Distribution by App Type", 
       x = "App Type", 
       y = "Price ($)") +
  theme_minimal()

Histogram for price distribution by App Type

ggplot(data_final, aes(x = Price, fill = Type)) +
  geom_histogram(binwidth = 60, alpha = 0.7, position = "identity") +
  facet_wrap(~ Type) +
  labs(title = "Price Distribution by App Type", 
       x = "Price ($)", 
       y = "Count") +
  theme_minimal()

Upon analyzing the price distribution across different app types, we found that some values in the Type column do not accurately represent the app prices (from above plot). Since we can fully rely on the Price values for our analysis, the Type column is seemed unnecessary.

Hence, Removing the Type column…

Dropping the Type column

#Using subset function
data_final <- subset(data_final, select = -Type)

#After removing the Type column and duplicated values
str(data_final)
## 'data.frame':    9659 obs. of  10 variables:
##  $ App           : chr  "Photo Editor & Candy Camera & Grid & ScrapBook" "Coloring book moana" "U Launcher Lite – FREE Live Cool Themes, Hide Apps" "Sketch - Draw & Paint" ...
##  $ Category      : Factor w/ 33 levels "ART_AND_DESIGN",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Rating        : num  4.1 3.9 4.7 4.5 4.3 4.4 3.8 4.1 4.4 4.7 ...
##  $ Reviews       : num  159 967 87510 215644 967 ...
##  $ Size          : num  19 14 8.7 25 2.8 5.6 19 29 33 3.1 ...
##  $ Installs      : num  1e+04 5e+05 5e+06 5e+07 1e+05 5e+04 5e+04 1e+06 1e+06 1e+04 ...
##  $ Price         : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Content.Rating: chr  "everyone" "everyone" "everyone" "teen" ...
##  $ Last.Updated  : Date, format: NA NA ...
##  $ Android.Ver   : Factor w/ 34 levels "1.0 and up","1.5 and up",..: 16 16 16 19 21 9 16 19 11 16 ...
The Type column is successfully removed.

Let’s do bivariate analysis on price and other variables starting from here.

Visulization for Distribution of Installs

# Bar plot for distribution of Installs
# Create a new data frame to store the factor levels
data_final1_factor <- data_final  

data_final1_factor$Installs <- factor(data_final$Installs)

# Create a bar plot with the ordered factor
ggplot(data_final1_factor, aes(x = Installs)) +
  geom_bar() +
  xlab("Installs") +
  ylab("Count") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +  
  ggtitle("Distribution of App Installs")

Visualization for Rating Distribution

boxplot(data_final$Rating,ylab = "Rating", xlab = "Count",col = "Blue")

hist(data_final$Rating, main="Histogram of Apps Rating after cleaning", xlab="Rating (count)", col = 'blue', breaks = 100 )

qqnorm(data_final$Rating)
qqline(data_final$Rating, col = "red")

Here, it could be seen the plots are much clearer but still skewed due to other outliers from 1-3 rating but as these may be the reason from which we could find why the apps are low rated hencecannot be removed from our dataset.

Visualization for Reviews

boxplot(data_final$Reviews,ylab = "Reviews", xlab = "Count",col = 'Blue')

hist(data_final$Reviews, main="Histogram of Apps Reviews", xlab="Reviews (count)", col = 'blue', breaks = 100 )

ggplot(data_final, aes(x = log(Reviews))) +
  geom_histogram(binwidth = 0.1, fill = "blue", color = "black") +
  labs(title = "Log-Transformed Histogram of Ratings", x = "Log(Rating)", y = "Count")

qqnorm(data_final$Reviews)
qqline(data_final$Reviews, col = "red")

Similar to the case of ratings the plots are skewed due to the outliers. Hence, we can use the log plot of reviews for the visualisation which is normalised version of Reviews. As they are skewed, they donot follow normal distribution.

Review frequency table

xkablesummary(data_final)
Table: Statistics summary.
App Category Rating Reviews Size Installs Price Content.Rating Last.Updated Android.Ver
Min Length:9659 FAMILY :1832 Min. :1.000 Min. : 0 Min. : 0.0085 Min. :0.000e+00 Min. : 0.000 Length:9659 Min. :NA 4.1 and up :2202
Q1 Class :character GAME : 959 1st Qu.:4.000 1st Qu.: 25 1st Qu.: 5.3000 1st Qu.:1.000e+03 1st Qu.: 0.000 Class :character 1st Qu.:NA 4.0.3 and up :1395
Median Mode :character TOOLS : 827 Median :4.200 Median : 967 Median : 13.1000 Median :1.000e+05 Median : 0.000 Mode :character Median :NA 4.0 and up :1285
Mean NA BUSINESS : 420 Mean :4.173 Mean : 216593 Mean : 20.1512 Mean :7.778e+06 Mean : 1.099 NA Mean :NaN Varies with device: 990
Q3 NA MEDICAL : 395 3rd Qu.:4.500 3rd Qu.: 29401 3rd Qu.: 27.0000 3rd Qu.:1.000e+06 3rd Qu.: 0.000 NA 3rd Qu.:NA 4.4 and up : 818
Max NA PERSONALIZATION: 376 Max. :5.000 Max. :78158306 Max. :100.0000 Max. :1.000e+09 Max. :400.000 NA Max. :NA 2.3 and up : 616
NA NA (Other) :4850 NA NA NA NA NA NA NA’s :9659 (Other) :2353
outlierKD2(data_final, Reviews)
## Outliers identified: 1656 
## Proportion (%) of outliers: 20.7 
## Mean of the outliers: 1228141 
## Mean without removing outliers: 216592.6 
## Mean if we remove outliers: 7280.61

To check which are outliers lets make sections of data that is create bins to check which bins have maximum data, this would help us see how reviews are distributed.

Binned reviews

Binning into equal count in each bin to check averge rating for each bin

# Define the new custom breaks for bins
# Ensure there are no NA values


# Define new breaks for more even intervals
breaks <- c(0, 100, 500, 1000, 2500, 5000, 10000, 25000,50000,100000, 300000,1000000,Inf)

# Create a categorical variable based on the new breaks
Review_Category <- cut(data_final$Reviews, breaks = breaks, right = FALSE, 
                   labels = c("0+","100+", "500+", "1K+",
                              "2.5K+", "5K+", "10K+","25K+",
                              "50K+", "100K+","300K+","1M+"))

# Count the number of values in each bin
bin_counts <- as.data.frame(table(Review_Category))

# Rename the columns for clarity
colnames(bin_counts) <- c("Review_Category", "Count")

# Print the counts
print(bin_counts)
##    Review_Category Count
## 1               0+  3327
## 2             100+  1065
## 3             500+   462
## 4              1K+   586
## 5            2.5K+   475
## 6              5K+   474
## 7             10K+   719
## 8             25K+   606
## 9             50K+   498
## 10           100K+   647
## 11           300K+   451
## 12             1M+   349
# Create a line plot of the binned counts
ggplot(bin_counts, aes(x = Review_Category, y = Count, group = 1)) +
  geom_line(color = "blue", size = 1) +
  geom_point(color = "blue", size = 3) +
  labs(title = "Count of Reviews by Review Category", 
       x = "Review Category", 
       y = "Count of Reviews") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Rotate x-axis labels for readability

Hence, high reviews can be observed in less apps and less reviews can be observed in more apps which is expected.

Visualization for Install Distribution

# Create a new data frame to store the factor levels
data_clean1_factor <- data_final  # Assuming you want to keep the original data intact
data_clean1_factor$Installs <- factor(data_final$Installs, levels = sorted_values)

# Define new breaks for more even intervals for Installs
install_breaks <- c(0, 500, 1000, 5000, 10000, 50000, 100000, 300000, 1000000, 5000000,10000000, Inf)

# Create a categorical variable for installs based on these breaks
data_clean1_factor$Installs_Category <- cut(
  as.numeric(as.character(data_final$Installs)), 
  breaks = install_breaks, 
  right = FALSE, 
  labels = c("0+", "500+", "1K+", "5K+", "10K+", "50K+", "100K+", "300K+", "1M+", "5M+","Above 10M+")
)


# Plot the categorized Installs data
library(ggplot2)
ggplot(data_clean1_factor, aes(x = Installs_Category)) +
  geom_bar() +
  xlab("Installs") +
  ylab("Count") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  ggtitle("Distribution of App Installs")

Visualization for Category Distribution

category_counts <- table(data_final$Category)

# Convert to data frame for plotting
category_counts_df <- as.data.frame(category_counts)
colnames(category_counts_df) <- c("Category", "Frequency") 

ggplot(category_counts_df, aes(x = reorder(Category, Frequency), y = Frequency)) + 
  geom_bar(stat = "identity", fill = "#1f3374") +
  geom_text(aes(label = Frequency), vjust = 0.5, hjust=1, size=2.5, color='#f8c220') +
  coord_flip() +  
  labs(title = "Distribution of Categories", x = "Category", y = "Frequency") +
  theme_minimal() +
   theme(
    plot.background = element_rect(fill = "#efefef", color = NA),
    panel.background = element_rect(fill = "#efefef", color = NA),
    axis.text.y = element_text(size = 5.5)
  )

AS it can be seen from the graph above, most of the apps in the dataset belong to the Family category, and Beauty has the least number of apps.

Visualization for Android Version

Below is the figure showing the distribution of Android versions.

extract_version <- function(version) {
  version <- tolower(version)  # Make lowercase for consistency
  
  # Handle "Varies with device" and "NaN"
  if (version == "varies with device" || version == "nan") return(NA)
  
  # Extract the first version in case of ranges (e.g., "4.1 - 7.1.1" -> "4.1")
  first_version <- strsplit(version, "[- ]")[[1]][1]
  
  # Remove "and up" if present (e.g., "4.0 and up" -> "4.0")
  first_version <- gsub("and up", "", first_version)
  
  return(as.numeric(first_version))  # Convert to numeric
}



df_clean <- data_final %>%
  mutate(Android_Ver = sapply(Android.Ver, extract_version)) %>%
  filter(!is.na(Android_Ver))  # Remove rows with NA in Android_Ver

android_installs <- data_final %>% 
  group_by(Android.Ver) %>% 
  summarize(Total_Installs = sum(Installs, na.rm = TRUE))



ggplot(df_clean, aes(x = Android_Ver)) + 
  geom_histogram(binwidth = 0.5, fill = "#1f3374", color='#efefef') + 
  scale_x_continuous(breaks = seq(1, 8, by = 1.0)) +  # Set x-axis ticks from 1.0 to 8.0
  theme_minimal() + 
  labs(
    title = "Distribution of Android Versions", 
    x = "Android Version", 
    y = "Count"
  ) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

As it can be seen that, the minimum required Android Version for most apps is 4.0 and up.

It can be seen that most Android Version have ratings range between 4.0 and 5.0.

Distribution and Visualisation for Content.Rating

# Clean and prepare the Last Updated  and Content column
data_updated <- data_final %>%
  mutate(
    Content.Rating = as.factor(Content.Rating)
  )

# 1. Content Rating Distribution
content_rating_dist <- table(data_updated$Content.Rating)
print("Content Rating Distribution:")
## [1] "Content Rating Distribution:"
print(content_rating_dist)
## 
## adults only 18+        everyone    everyone 10+      mature 17+            teen 
##               3            7903             322             393            1036 
##         unrated 
##               2
# Bar plot for Content Rating
ggplot(data_final, aes(x = Content.Rating)) +
  geom_bar(fill = "skyblue") +
  geom_text(stat = "count", aes(label = ..count..), vjust = -0.5) +
  labs(title = "Distribution of App Content Ratings",
       x = "Content Rating",
       y = "Number of Apps") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Everyone is the most dominant Category with 81.82% of all apps and Adults 18+ being most least significant category with about 0.03% of overall app population

Multivariate Analysis

Visualization for Price vs Installs

#Plotting a scatter plot between Price and installs
ggplot(data_final, aes(x=Price, y=log(data_final$Installs))) +
  geom_point(color = 'red', size = 1, alpha = 0.5) + 
  geom_smooth(method = 'lm', color = 'blue', se = FALSE) +
  labs(title = "Price vs Installs", x = "Price (USD)", y = "Number of Installs") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

From the scatter plot, we can see that there are more number of installations with price value 0.

Visualisation of Mean Installs for each Price Category

For a better visualization, we are categorizing price values 0 as free apps and plotting abox plot.

# Categorize the apps as "Free" or "Paid" based on Price
Price_Category <- ifelse(data_final$Price == 0, "Free", "Paid")
str(data_final$Price)
##  num [1:9659] 0 0 0 0 0 0 0 0 0 0 ...
str(Price_Category)
##  chr [1:9659] "Free" "Free" "Free" "Free" "Free" "Free" "Free" "Free" ...
#str(log(data_final$Installs))

# Box plot of Price Category vs. log-transformed Installs
ggplot(data_final, aes(x = Price_Category, y = log(data_final$Installs))) +
  geom_boxplot(fill = "lightblue", color = "darkblue", alpha = 0.6) +
  labs(title = "Price Categories vs. Log-Transformed Installs", 
       x = "Price Category", 
       y = "Log(Installs)") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  

# Categorize the apps as "Free" or "Paid" based on Price
Price_Category <- ifelse(data_final$Price == 0, "Free", "Paid")
str(data_final$Price)
##  num [1:9659] 0 0 0 0 0 0 0 0 0 0 ...
str(Price_Category)
##  chr [1:9659] "Free" "Free" "Free" "Free" "Free" "Free" "Free" "Free" ...
#str(data_final$log(data_final$Installs))

table(Price_Category)
## Price_Category
## Free Paid 
## 8903  756

“Free” apps tend to have more installs than “Paid” apps. The difference between the means on the log scale is estimated to be between 3.47 and 3.97.

# Add Price_Category to data_final
data_duplicate <- data_final
data_duplicate$Price_Category <- ifelse(data_final$Price == 0, "Free", "Paid")

# Filter out rows with Installs <= 0 before summarizing
summary_table <- data_duplicate %>%
  filter(Installs > 0) %>%
  group_by(Price_Category) %>%
  summarise(Average_Log_Installs = mean(log(Installs), na.rm = TRUE),
            Count = n())

# View the summarized table
kable(summary_table, format = "html", col.names = c("Price Category", "Mean Log(Installs)", "App Count")) %>%
  kable_styling(full_width = FALSE, position = "center")
Price Category Mean Log(Installs) App Count
Free 10.993080 8898
Paid 7.250958 746

Visualization for Price vs Reviews & Rating

# Plot Price vs. Reviews
ggplot(data_final, aes(x=Price, y=Reviews)) +
  geom_point(color = 'blue') +
  geom_smooth(method = 'lm', color = 'red', se = FALSE) +
  labs(title = "Price vs Reviews", x = "Price (USD)", y = "Number of Reviews") +
  theme_minimal() + 
  theme(
    panel.background = element_rect(fill = "white"),  # Set panel background to white
    plot.background = element_rect(fill = "white"),   # Set plot background to white
    axis.text.x = element_text(angle = 45, hjust = 1)
  )

# Plot Price vs. Rating
ggplot(data_final, aes(x=Price, y=Rating)) +
  geom_point(color = 'green') +
  geom_smooth(method = 'lm', color = 'red', se = FALSE) +
  labs(title = "Price vs Rating", x = "Price (USD)", y = "Rating") +
  theme_minimal() + 
  theme(
    panel.background = element_rect(fill = "white"),  # Set panel background to white
    plot.background = element_rect(fill = "white"),   # Set plot background to white
    axis.text.x = element_text(angle = 45, hjust = 1)
  )

ggplot(data_final, aes(x = Rating, fill = Price)) +
  geom_density(alpha = 0.5) + 
  labs(title = "Kernel Density Estimate of App Ratings by Price Category",
       x = "Rating", 
       y = "Density") +
  theme_minimal() 

Price vs Reviews with installation: Cheaper products tend to have more reviews, indicating higher popularity or more frequent purchases. In contrast, expensive products tend to have fewer reviews, possibly because fewer people buy higher-priced items.

Price vs Ratings with installation: Price does not strongly affect the average rating, but there is a slight trend where lower-priced products have more variation in ratings, while higher-priced products tend to receive more consistent ratings around 4. May be higher price apps are meeting the customer expectations.

Concluding: Apps with lower prices, have more ratings and installs while apps priced higher tend to have fewer installs and more scattered ratings. Similarly, for reviews.

Visualization for Installs Vs Size

ggplot(data_final, aes(x = Size, y = log(Installs))) +
  geom_hex(bins = 30) +
  scale_fill_viridis_c() + # Adds color gradient
  labs(title = "Plot of App Size vs. Installs (Log Scale)",
       x = "Size (MB)",
       y = "Installs (Log Scale)") +
  theme_minimal()

Visualization for Price vs Size

# Plot Price vs Size
ggplot(data_final, aes(x=Price, y=Size)) +
  geom_point(color = 'red') + 
  geom_smooth(method = 'lm', color = 'blue', se = FALSE) +
  labs(title = "Price vs Size", x = "Price (USD)", y = "App Size (MB)") +
  theme_minimal() 

# Create a KDE plot for Size based on Price_Category
ggplot(data_final, aes(x = Size, fill = Price)) +
  geom_density(alpha = 0.5) + 
  labs(title = "Kernel Density Estimate of App Size by Price Category",
       x = "App Size (MB)", 
       y = "Density") +
  theme_minimal() 

Boxplots for Rating vs Reviews

boxplot( data_final$Rating~ Review_Category, data = data_final, 
        main = "Boxplot of Review Counts by Review Category", 
        xlab = "Review Category", 
        ylab = "Review Rating",
        las = 2,        # Rotate the x-axis labels for readability
        col = "lightblue")  # Optional: Set color for the boxplots

In this we could observe that, as reviews increase the median of rating increased and the values clustered around higher ratings which could show that high reviews, could mean a better rated app.

Mean value of Ratings for each Review bins

# Calculate the mean Rating for each Review_Category
mean_ratings <- tapply(data_final$Rating, Review_Category, mean, na.rm = TRUE)

# Convert the result to a data frame for better readability
mean_ratings_df <- data.frame(Review_Category = names(mean_ratings), Mean_Rating = as.numeric(mean_ratings))

# Print the mean ratings for each review bin
print(mean_ratings_df)
##    Review_Category Mean_Rating
## 1               0+    4.126221
## 2             100+    4.029538
## 3             500+    4.063188
## 4              1K+    4.107030
## 5            2.5K+    4.129572
## 6              5K+    4.191139
## 7             10K+    4.221836
## 8             25K+    4.231848
## 9             50K+    4.293775
## 10           100K+    4.329830
## 11           300K+    4.375610
## 12             1M+    4.426361
# Define correct order of Review_Category as a factor
mean_ratings_df$Review_Category <- factor(mean_ratings_df$Review_Category, 
                                          levels = c("0+","100+", "500+", "1K+",
                                                     "2.5K+", "5K+", "10K+","25K+",
                                                     "50K+", "100K+", "300K+", "1M+"))

# Plot the mean ratings for each review bin in the correct order
ggplot(mean_ratings_df, aes(x = Review_Category, y = Mean_Rating)) +
  geom_bar(stat = "identity", fill = "steelblue") +  # Use bar plot
  labs(title = "Mean Rating by Review Category",
       x = "Review Category",
       y = "Mean Rating") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Rotate x-axis labels for readability

As we can see, the mean rating increases as the reviews increase.

Visualization for Reviews vs Installs

# Scatter plot for Installs vs Reviews
ggplot(data_final1_factor, aes(x = Review_Category, y = Installs)) +
  geom_point(color = "blue", alpha = 0.5) +
  labs(title = "Scatter Plot of Installs vs Reviews", 
       x = "Number of Reviews", 
       y = "Number of Installs") +
  theme_minimal()

Visualization for Rating vs Installs

# Scatter plot of log-transformed Installs vs. Rating
ggplot(data_final, aes(x = log(data_final$Installs), y = Rating)) +
  geom_point(color = "blue", alpha = 0.6) +
  geom_smooth(method = "lm", color = "red", se = FALSE) +  # Add a regression line
  labs(title = "Log-Transformed Installs vs. Rating", 
       x = "Log(Installs)", 
       y = "Rating") +
  theme_minimal()

Visualization for Rating vs Installs by Category

Visualization for Category vs. Installs

Below is a boxplot show the distribution of number of installs for each category order by mean from highest to lowest.

ggplot(data_final, aes(x = reorder(Category, log(data_final$Installs),  FUN = mean), y = log(data_final$Installs))) +
  geom_boxplot(outlier.color = "#f05555", outlier.shape = 1, color='#1f3374', fill="#efefef") +  # Red outliers for emphasis
  coord_flip() +  # Flip for better readability
  scale_y_log10() +
  theme_minimal() +
  labs(title = "Distribution of Installs by Category",
       x = "Category",
       y = "Number of Installs (Log Scale)") +
    theme(
    plot.background = element_rect(fill = "#efefef", color = NA),
    panel.background = element_rect(fill = "#efefef", color = NA),
    axis.text.y = element_text(size = 5.5)
  )

It can be seen from the graph that, on average, Entertainment apps receive the highest number of installations, followed by Education, Game, Photography, and Weather apps. In contrast, Art & Design apps have the fewest installations.

Visualization of App size vs Category

#df_clean <- data_final %>%
 # mutate(Size = sapply(Size, convert_size)) %>%
#  filter(!is.na(Size))

# Plot the histogram with faceting by category
ggplot(data_final, aes(x = Size)) +
  geom_histogram(binwidth = 5, fill = "#304ba6", color = "black") +
  facet_wrap(~ Category, scales = "free_y") +
  theme_minimal() +
  labs(
    title = "Distribution of App Sizes by Category",
    x = "Size (MB)",
    y = "Count"
  ) +
  theme(
    strip.text = element_text(size = 5),
    axis.text.x = element_text(size = 7, angle = 45, hjust = 1)
  )

str(data_final)
## 'data.frame':    9659 obs. of  10 variables:
##  $ App           : chr  "Photo Editor & Candy Camera & Grid & ScrapBook" "Coloring book moana" "U Launcher Lite – FREE Live Cool Themes, Hide Apps" "Sketch - Draw & Paint" ...
##  $ Category      : Factor w/ 33 levels "ART_AND_DESIGN",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Rating        : num  4.1 3.9 4.7 4.5 4.3 4.4 3.8 4.1 4.4 4.7 ...
##  $ Reviews       : num  159 967 87510 215644 967 ...
##  $ Size          : num  19 14 8.7 25 2.8 5.6 19 29 33 3.1 ...
##  $ Installs      : num  1e+04 5e+05 5e+06 5e+07 1e+05 5e+04 5e+04 1e+06 1e+06 1e+04 ...
##  $ Price         : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ Content.Rating: chr  "everyone" "everyone" "everyone" "teen" ...
##  $ Last.Updated  : Date, format: NA NA ...
##  $ Android.Ver   : Factor w/ 34 levels "1.0 and up","1.5 and up",..: 16 16 16 19 21 9 16 19 11 16 ...
ggplot(data_final, aes(x = reorder(Category, Size, FUN = median), y = Size)) + 
  geom_boxplot(outlier.color = "#f05555", outlier.shape = 1) + 
  coord_flip() + 
  theme_minimal() + 
  labs(
    title = "Boxplot of App Sizes by Category (Ordered by Median)", 
    x = "Category", 
    y = "Size (MB)"
  ) + 
  theme(
    strip.text = element_text(size = 8), 
    axis.text.x = element_text(size = 7, angle = 45, hjust = 1)
  )

As it can be seen from the two figures above, most categories exhibit right-skewed app sizes, with the majority being under 50MB. However, the Game category stands out with a significantly larger median app size compared to other categories.

Visualization for Category vs. Reviews

Below is the graph displaying the distribution of reviews left by users for each category.

df_aggregated <- data_final %>% 
  group_by(Category) %>% 
  summarise(Total_Reviews = sum(Reviews, na.rm = TRUE))

#df_aggregated

# Plot the total reviews by category using a bar chart
ggplot(df_aggregated, aes(x = reorder(Category, -Total_Reviews), y = log10(Total_Reviews))) + 
  geom_bar(stat = "identity", fill = "#1f3374") + 
  labs(
    title = "Log-Scaled Total Reviews by Category", 
    x = "Category", 
    y = "Log10(Total Number of Reviews)"
  ) + 
  theme_minimal() + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

AS it can be seen that game,communication apps have most reviews while events apps have the least reviews.

Histogram for Category vs. Rating

Below is the figure demonstrating the distribution of number of rating for each category.

ggplot(data_final, aes(x = Rating)) + 
  geom_histogram(binwidth = 0.5, fill = "#1f3374", color='#efefef') + 
  facet_wrap(~ Category, scales = "free_y") +  # Facet by Category with independent y-axis
  scale_x_continuous(limits = c(1, 5), breaks = seq(1, 5, by = 0.5)) +  # Restrict x-axis to 1-5
  theme_minimal() + 
  labs(
    title = "Distribution of Ratings by Category", 
    x = "Rating", 
    y = "Count"
  ) + 
  theme(
    strip.text = element_text(size = 5),  # Adjust facet label size
    axis.text.x = element_text(size = 5, angle = 45, hjust = 1),  # Rotate x-axis labels
    plot.title = element_text(hjust = 0.5)  # Center the plot title
  )

As illustrated in the graph above, all categories have app ratings that range between 4.0 and 5.0.

Bar plot for Android Version vs. Installs

Below is the graph showing the number of installs for each minimum required Android Version.

ggplot(data_final, aes(x = reorder(Android.Ver, Installs), y = Installs)) + 
  geom_bar(stat = "identity", fill = "#1f3374") + 
  coord_flip() +  # Flip coordinates for better readability
  scale_y_continuous(labels = scales::comma) +  # Format y-axis with commas
  theme_minimal() + 
  labs(
    title = "Total Installs by Android Version", 
    x = "Android Version", 
    y = "Total Installs"
  ) + 
  theme(
    axis.text.y = element_text(size = 8),  # Adjust y-axis text size
    plot.title = element_text(hjust = 0.5)  # Center the plot title
  )

It can be seen that the highest number of installation is when there is different requirements of the versions for the app to run.

Histogram for Android Version vs. Rating

Below is the plot showing the number of ratings for each Android Version.

ggplot(df_clean, aes(x = Rating, fill = Android.Ver)) + 
  geom_histogram(binwidth = 0.5, position = "stack", color = "black", alpha = 0.7) + 
  scale_x_continuous(breaks = seq(1, 5, by = 0.5)) +  # Set x-axis breaks
  theme_minimal() + 
  labs(
    title = "Histogram of Ratings by Android Version", 
    x = "Rating", 
    y = "Count"
  ) + 
  theme(
    axis.text.x = element_text(size = 8), 
    axis.text.y = element_text(size = 8), 
    plot.title = element_text(hjust = 0.5)  # Center the plot title
  )

It can be seen that most Android Version have ratings range between 4.0 and 5.0.

Update Frequency

# Content Rating and Update Frequency Relationship
update_frequency_by_rating <- data_final %>%
  group_by(Content.Rating) %>%
  summarize(
    avg_last_update = mean(Last.Updated),
    median_last_update = median(Last.Updated),
    n_apps = n()
  )
print("\nUpdate Frequency by Content Rating:")
## [1] "\nUpdate Frequency by Content Rating:"
print(update_frequency_by_rating)
## # A tibble: 6 × 4
##   Content.Rating  avg_last_update median_last_update n_apps
##   <chr>           <date>          <date>              <int>
## 1 adults only 18+ NA              NA                      3
## 2 everyone        NA              NA                   7903
## 3 everyone 10+    NA              NA                    322
## 4 mature 17+      NA              NA                    393
## 5 teen            NA              NA                   1036
## 6 unrated         NA              NA                      2
# Basic statistics for Installs by Content Rating
installs_by_rating <- data_final %>%
  group_by(Content.Rating) %>%
  summarise(
    mean_installs = mean(Installs, na.rm = TRUE),
    median_installs = median(Installs, na.rm = TRUE),
    total_installs = sum(Installs, na.rm = TRUE),
    n_apps = n()
  ) %>%
  arrange(desc(mean_installs))

print("Summary of Installs by Content Rating:")
## [1] "Summary of Installs by Content Rating:"
print(installs_by_rating)
## # A tibble: 6 × 5
##   Content.Rating  mean_installs median_installs total_installs n_apps
##   <chr>                   <dbl>           <dbl>          <dbl>  <int>
## 1 teen                15914358.          500000    16487275393   1036
## 2 everyone 10+        12472894.         1000000     4016271795    322
## 3 everyone             6602474.           50000    52179352961   7903
## 4 mature 17+           6203529.          500000     2437986878    393
## 5 adults only 18+       666667.          500000        2000000      3
## 6 unrated                25250            25250          50500      2

Last updated vs Content Rating

# Required libraries


# Create days_since_update and data preparation
data_updated <- data_final %>%
  mutate(
    # Convert Last.Updated to proper date format (assuming it's in standard format)
    last_updated = as.Date(Last.Updated, format = "%B %d, %Y"),
    current_date = Sys.Date(),
    # Calculate days since last update
    days_since_update = as.numeric(difftime(current_date, last_updated, units = "days")),
    # Extract month from last_updated date
    update_month = month(last_updated)
  ) %>%
  # Remove any invalid dates or NA values
  filter(!is.na(last_updated), !is.na(days_since_update))

# Create subset for update analysis
data_updated <- data_updated %>% filter(!is.na(days_since_update))

# Calculate update statistics by Content Rating
update_patterns <- data_updated %>%
  group_by(Content.Rating) %>%
  summarize(
    avg_days_since_update = mean(days_since_update, na.rm = TRUE),
    median_days_since_update = median(days_since_update, na.rm = TRUE),
    sd_days_since_update = sd(days_since_update, na.rm = TRUE),
    n_apps = n(),
    cv = sd_days_since_update / avg_days_since_update * 100  # Coefficient of Variation
  ) %>%
  arrange(avg_days_since_update)

print("\nUpdate Patterns by Content Rating:")
## [1] "\nUpdate Patterns by Content Rating:"
print(update_patterns)
## # A tibble: 0 × 6
## # ℹ 6 variables: Content.Rating <chr>, avg_days_since_update <dbl>,
## #   median_days_since_update <dbl>, sd_days_since_update <dbl>, n_apps <int>,
## #   cv <dbl>
# Create monthly update counts
update_heatmap_data <- data_updated %>%
  group_by(update_month, Content.Rating) %>%
  summarize(count = n(), .groups = 'drop') %>%
  # Ensure all months and ratings are included, even if count is 0
  complete(
    update_month = 1:12,
    Content.Rating = unique(data_updated$Content.Rating),
    fill = list(count = 0)
  ) %>%
  # Reshape data for heatmap
  pivot_wider(
    names_from = Content.Rating,
    values_from = count
  )

# Convert to matrix for traditional heatmap
update_matrix <- as.matrix(update_heatmap_data[,-1])
rownames(update_matrix) <- month.abb[update_heatmap_data$update_month]

# Create enhanced heatmap using ggplot2
heatmap_data_long <- melt(update_matrix)
colnames(heatmap_data_long) <- c("Month", "Content_Rating", "Count")
heatmap_data_long$Month <- factor(heatmap_data_long$Month, levels = month.abb)

# Create the heatmap visualization
ggplot(heatmap_data_long, aes(x = Content_Rating, y = Month, fill = Count)) +
  geom_tile(color = "white") +  # Add white borders between tiles
  scale_fill_gradient(
    low = "white", 
    high = "steelblue", 
    name = "Number of Updates"
  ) +
  theme_minimal() +
  labs(
    title = "App Update Patterns by Content Rating",
    x = "Content Rating",
    y = "Month",
    subtitle = paste("Data as of", format(Sys.Date(), "%B %d, %Y"))
  ) +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1),
    plot.title = element_text(hjust = 0.5, face = "bold"),
    plot.subtitle = element_text(hjust = 0.5),
    panel.grid = element_blank(),
    panel.border = element_rect(fill = NA, color = "grey80"),
    legend.position = "right"
  )

# Calculate update velocity
update_velocity <- data_updated %>%
  group_by(Content.Rating) %>%
  summarize(
    update_velocity = n() / n_distinct(update_month),
    total_apps = n(),
    avg_days_between_updates = mean(days_since_update, na.rm = TRUE)
  ) %>%
  arrange(desc(update_velocity))

print("\nUpdate Velocity by Content Rating:")
## [1] "\nUpdate Velocity by Content Rating:"
print(update_velocity)
## # A tibble: 0 × 4
## # ℹ 4 variables: Content.Rating <chr>, update_velocity <dbl>, total_apps <int>,
## #   avg_days_between_updates <dbl>
# Optional: Additional summary statistics for days since update
summary_stats <- data_updated %>%
  summarize(
    mean_days = mean(days_since_update, na.rm = TRUE),
    median_days = median(days_since_update, na.rm = TRUE),
    min_days = min(days_since_update, na.rm = TRUE),
    max_days = max(days_since_update, na.rm = TRUE),
    q1_days = quantile(days_since_update, 0.25, na.rm = TRUE),
    q3_days = quantile(days_since_update, 0.75, na.rm = TRUE)
  )

print("\nOverall Summary Statistics for Days Since Update:")
## [1] "\nOverall Summary Statistics for Days Since Update:"
print(summary_stats)
##   mean_days median_days min_days max_days q1_days q3_days
## 1       NaN          NA      Inf     -Inf      NA      NA
# Update Interval Analysis
update_intervals <- data_updated %>%
  group_by(Content.Rating) %>%
  arrange(Last.Updated) %>%
  mutate(days_between_updates = as.numeric(Last.Updated - lag(Last.Updated))) %>%
  summarise(
    mean_interval = mean(days_between_updates, na.rm = TRUE),
    median_interval = median(days_between_updates, na.rm = TRUE),
    std_dev = sd(days_between_updates, na.rm = TRUE),
    cv = std_dev / mean_interval * 100  # Coefficient of Variation
  )

print("Update Interval Analysis:")
## [1] "Update Interval Analysis:"
print(update_intervals)
## # A tibble: 0 × 5
## # ℹ 5 variables: Content.Rating <chr>, mean_interval <dbl>,
## #   median_interval <dbl>, std_dev <dbl>, cv <dbl>
# Create data_updated with seasonal information while keeping data_final unchanged
data_updated <- data_final %>%
  mutate(
    last_updated = as.Date(Last.Updated, format = "%B %d, %Y"),
    current_date = Sys.Date(),
    days_since_update = as.numeric(difftime(current_date, last_updated, units = "days")),
    update_month = month(last_updated),
    season = case_when(
      update_month %in% c(12, 1, 2) ~ "Winter",
      update_month %in% c(3, 4, 5) ~ "Spring",
      update_month %in% c(6, 7, 8) ~ "Summer",
      update_month %in% c(9, 10, 11) ~ "Fall"
    )
  ) %>%
  filter(!is.na(last_updated), !is.na(days_since_update))

# Calculate seasonal update intensity
seasonal_intensity <- data_updated %>%
  group_by(Content.Rating, season) %>%
  summarise(
    update_count = n(),
    update_intensity = n() / n_distinct(last_updated),
    avg_days_between_updates = mean(days_since_update, na.rm = TRUE),
    .groups = 'drop'
  ) %>%
  mutate(season = factor(season, levels = c("Winter", "Spring", "Summer", "Fall"))) %>%
  arrange(Content.Rating, desc(update_intensity))

# Create enhanced seasonal bar plot
seasonal_plot <- ggplot(seasonal_intensity, 
       aes(x = season, y = update_intensity, fill = Content.Rating)) +
  geom_bar(stat = "identity", position = "dodge", width = 0.8) +
  scale_fill_brewer(palette = "Set3") +
  labs(
    title = "Seasonal Update Intensity by Content Rating",
    subtitle = paste("Analysis Period:", format(min(data_updated$last_updated), "%B %Y"), 
                    "to", format(max(data_updated$last_updated), "%B %Y")),
    x = "Season",
    y = "Update Intensity",
    fill = "Content Rating"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold", size = 14),
    plot.subtitle = element_text(hjust = 0.5, size = 10),
    axis.text.x = element_text(angle = 0),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),
    legend.position = "right"
  )

# Create seasonal heatmap
seasonal_heatmap <- ggplot(seasonal_intensity, 
       aes(x = season, y = Content.Rating, fill = update_intensity)) +
  geom_tile(color = "white") +
  scale_fill_gradient2(
    low = "white",
    high = "steelblue",
    name = "Update\nIntensity"
  ) +
  labs(
    title = "Seasonal Update Patterns Heatmap",
    x = "Season",
    y = "Content Rating"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold"),
    axis.text.x = element_text(angle = 0),
    panel.grid = element_blank(),
    legend.position = "right"
  )

# Print both plots side by side
library(gridExtra)
grid.arrange(seasonal_plot, seasonal_heatmap, ncol = 2)

# Print seasonal statistics
print("\nSeasonal Update Intensity Statistics:")
## [1] "\nSeasonal Update Intensity Statistics:"
print(seasonal_intensity)
## # A tibble: 0 × 5
## # ℹ 5 variables: Content.Rating <chr>, season <fct>, update_count <int>,
## #   update_intensity <dbl>, avg_days_between_updates <dbl>
# Additional seasonal summary
seasonal_summary <- data_updated %>%
  group_by(season) %>%
  summarise(
    total_updates = n(),
    avg_days_since_update = mean(days_since_update, na.rm = TRUE),
    median_days_since_update = median(days_since_update, na.rm = TRUE),
    n_apps = n_distinct(Content.Rating),
    .groups = 'drop'
  ) %>%
  arrange(match(season, c("Winter", "Spring", "Summer", "Fall")))

print("\nOverall Seasonal Summary:")
## [1] "\nOverall Seasonal Summary:"
print(seasonal_summary)
## # A tibble: 0 × 5
## # ℹ 5 variables: season <chr>, total_updates <int>,
## #   avg_days_since_update <dbl>, median_days_since_update <dbl>, n_apps <int>
# Create stacked area chart for seasonal trends
seasonal_trend <- data_updated %>%
  group_by(season, Content.Rating) %>%
  summarise(
    update_count = n(),
    .groups = 'drop'
  ) %>%
  ggplot(aes(x = season, y = update_count, fill = Content.Rating)) +
  geom_area(position = "stack") +
  scale_fill_brewer(palette = "Set3") +
  labs(
    title = "Seasonal Update Distribution",
    x = "Season",
    y = "Number of Updates",
    fill = "Content Rating"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold"),
    axis.text.x = element_text(angle = 0),
    panel.grid.minor = element_blank()
  )

print(seasonal_trend)

The visualization shows the seasonal update intensity for various content ratings across different seasons (Fall, Spring, Summer, and Winter). The “Update Intensity” measures how frequently updates occurred, normalized by the number of distinct update events. The graph reveals that content rated as “everyone” consistently exhibits higher update intensity across all seasons, particularly peaking during the Summer. Other content ratings, such as “mature 17+” and “teen,” show notable but lower intensities, with a generally even distribution across seasons. This pattern suggests that applications rated for general audiences tend to undergo more frequent updates, especially during the Summer, potentially to meet increased demand or prepare for seasonal trends.

Visualization for Content Rating vs Installs

installs_by_rating <- data_updated %>%
  group_by(Content.Rating) %>%
  summarise(
    mean_installs = mean(Installs, na.rm = TRUE),
    median_installs = median(Installs, na.rm = TRUE),
    total_installs = sum(Installs, na.rm = TRUE),
    n_apps = n()
  ) %>%
  arrange(desc(mean_installs))

# Visualize distribution of installs by content rating
ggplot(data_updated, aes(x = Content.Rating, y = log10(Installs))) +
  geom_boxplot(fill = "lightblue") +
  labs(title = "Distribution of App Installs by Content Rating",
       x = "Content Rating",
       y = "Log10(Number of Installs)") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Distribution of Installations by Update Recency and Content Rating

data_analysis <- data_updated %>%
  mutate(
    Last.Updated = as.Date(Last.Updated, format = "%Y-%m-%d"),
    days_since_update = as.numeric(difftime(max(Last.Updated), Last.Updated, units = "days")),
    update_year = year(Last.Updated),
    update_month = month(Last.Updated)
  )


data_analysis <- data_analysis %>%
  mutate(update_recency = ifelse(days_since_update <= median(days_since_update),
                                "Recent Update", "Old Update"))

recent_vs_old <- data_analysis %>%
  group_by(Content.Rating, update_recency) %>%
  summarise(
    mean_installs = mean(Installs, na.rm = TRUE),
    median_installs = median(Installs, na.rm = TRUE),
    n_apps = n()
  )

print("\nComparison of Installs by Update Recency and Content Rating:")
## [1] "\nComparison of Installs by Update Recency and Content Rating:"
print(recent_vs_old)
## # A tibble: 0 × 5
## # Groups:   Content.Rating [0]
## # ℹ 5 variables: Content.Rating <chr>, update_recency <lgl>,
## #   mean_installs <dbl>, median_installs <dbl>, n_apps <int>
# 7. Visualization of update recency effect
ggplot(data_analysis, aes(x = Content.Rating, y = log10(Installs), fill = update_recency)) +
  geom_boxplot() +
  labs(title = "Install Distribution by Content Rating and Update Recency",
       x = "Content Rating",
       y = "Log10(Number of Installs)",
       fill = "Update Recency") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

The boxplot shows the distribution of app installs across different content ratings, segmented by update recency (old vs. recent).

Apps with recent updates generally have higher median installs compared to those with older updates, indicating that more frequently updated apps tend to attract more users.

This trend is evident across most content ratings, especially for categories like “everyone” and “teen,” where recent updates show a noticeable increase in the upper range of installs. For “everyone 10+” and “mature 17+,” the difference between old and recent updates is less pronounced, suggesting that the effect of update recency on installs might be weaker in these categories.

The “adults only 18+” and “unrated” categories still exhibit lower install numbers overall, regardless of update recency, highlighting the limited popularity of these app types.

Visualization for Last Updated vs Content Rating vs Installs

# 3. Timeline analysis: Average installs over time by content rating
installs_timeline <- data_updated %>%
  group_by(Content.Rating, Last.Updated) %>%
  summarise(avg_installs = mean(Installs, na.rm = TRUE)) %>%
  ungroup()

ggplot(installs_timeline, aes(x = Last.Updated, y = log10(avg_installs), color = Content.Rating)) +
  geom_smooth(method = "loess", se = FALSE) +
  labs(title = "Average App Installs Over Time by Content Rating",
       x = "Last Updated Date",
       y = "Log10(Average Installs)") +
  theme_minimal() +
  theme(legend.position = "bottom")

The line graph depicts the trend of average app installs over time for different content ratings, with the y-axis on a logarithmic scale (log10). The curves reveal that apps with broader content ratings like “everyone” and “everyone 10+” show significant growth in average installs, particularly from 2016 onwards, reaching a peak around 2018. This indicates a surge in popularity and possibly greater user engagement or app availability during that period. Similarly, “mature 17+” apps follow a parallel trend but start with higher average installs and decline around 2012 before recovering alongside the other categories.

The “teen” content rating exhibits a unique pattern with fluctuating growth, maintaining relatively steady installs before rising sharply from 2016 onwards. In contrast, “adults only 18+” shows a limited increase, suggesting that apps with this rating have a smaller user base. The convergence of all content ratings towards higher install averages near 2018 reflects an overall trend in the app market where app downloads increased across various content ratings.

summary(data_final)
##      App                       Category        Rating         Reviews        
##  Length:9659        FAMILY         :1832   Min.   :1.000   Min.   :       0  
##  Class :character   GAME           : 959   1st Qu.:4.000   1st Qu.:      25  
##  Mode  :character   TOOLS          : 827   Median :4.200   Median :     967  
##                     BUSINESS       : 420   Mean   :4.173   Mean   :  216593  
##                     MEDICAL        : 395   3rd Qu.:4.500   3rd Qu.:   29401  
##                     PERSONALIZATION: 376   Max.   :5.000   Max.   :78158306  
##                     (Other)        :4850                                     
##       Size             Installs             Price         Content.Rating    
##  Min.   :  0.0085   Min.   :0.000e+00   Min.   :  0.000   Length:9659       
##  1st Qu.:  5.3000   1st Qu.:1.000e+03   1st Qu.:  0.000   Class :character  
##  Median : 13.1000   Median :1.000e+05   Median :  0.000   Mode  :character  
##  Mean   : 20.1512   Mean   :7.778e+06   Mean   :  1.099                     
##  3rd Qu.: 27.0000   3rd Qu.:1.000e+06   3rd Qu.:  0.000                     
##  Max.   :100.0000   Max.   :1.000e+09   Max.   :400.000                     
##                                                                             
##   Last.Updated              Android.Ver  
##  Min.   :NA     4.1 and up        :2202  
##  1st Qu.:NA     4.0.3 and up      :1395  
##  Median :NA     4.0 and up        :1285  
##  Mean   :NaN    Varies with device: 990  
##  3rd Qu.:NA     4.4 and up        : 818  
##  Max.   :NA     2.3 and up        : 616  
##  NA's   :9659   (Other)           :2353

Descriptive Statstics

The descriptive statistics for the Google Play Store dataset provide insights into app ratings, popularity, size, installation counts, and pricing.

  • Rating: App ratings range from 1 to 5, with an average rating of 4.17, indicating generally positive user feedback. Most ratings fall between 4 and 4.5.
  • Reviews: The number of reviews is highly skewed; while the average is over 216,000 reviews, the median is only 967, suggesting that a few popular apps have amassed the majority of reviews.
  • Size: App sizes vary widely, with a mean of 20.15 MB. Most apps fall within 5.3 to 27 MB, and the largest app size recorded is 100 MB.
  • Installs: The median app has 100,000 installs, while the mean is significantly higher at 7.78 million installs, highlighting that a small number of highly popular apps inflate the average.
  • Price: Most apps are free, with a median price of $0. A small percentage are paid, with prices ranging up to $400, though the mean price remains low at $1.10.
  • For categorical variables, apps are most commonly categorized under FAMILY, followed by GAME and TOOLS. Common Android version requirements are 4.1 and up and 4.0.3 and up.

Correlation

Correlation for all variables in data_final

Lets convert all the categorical variables into factors and then convert into numerical dataframe for caluclating the correlation matrix

# Step 1: Create a copy of the original data without specific columns
columns_to_remove <- c("App", "Scaled_Reviews", "update_year", "update_month", 
                      "update_quarter", "days_since_update", "week_of_year", 
                      "Last.Updated", "day_of_week", "month_of_year", "season")
data_numeric_or_factor <- data_final %>%
  select(-any_of(columns_to_remove))  # Changed to any_of to handle missing columns gracefully

# Step 2: Identify and convert character columns to factors
data_numeric_or_factor <- data_numeric_or_factor %>%
  mutate(across(where(is.character), as.factor))

# Step 3: Create a copy for factor data
data_factor <- data_numeric_or_factor

# Step 4: Identify numeric and factor columns
numeric_columns <- sapply(data_numeric_or_factor, is.numeric)
factor_columns <- sapply(data_numeric_or_factor, is.factor)

# Step 5: Convert factors to numeric while preserving numeric columns
data_final_numeric <- data_numeric_or_factor %>%
  mutate(across(where(is.factor), ~as.numeric(as.factor(.))))

# Step 6: Check for any non-numeric columns and remove them
non_numeric_cols <- names(data_final_numeric)[!sapply(data_final_numeric, is.numeric)]
if(length(non_numeric_cols) > 0) {
  data_final_numeric <- data_final_numeric %>%
    select(-all_of(non_numeric_cols))
}

# Step 7: Calculate correlations
# Pearson correlation
pearson_correlation <- cor(data_final_numeric, 
                         method = "pearson", 
                         use = "complete.obs")

# Spearman correlation
spearman_correlation <- cor(data_final_numeric, 
                          method = "spearman", 
                          use = "complete.obs")


corrplot(pearson_correlation,
         method = "color",
         type = "upper",
         order = "hclust",
         addCoef.col = "black",
         tl.col = "black",
         tl.srt = 45,
         number.cex = 0.7,
         title = "Pearson Correlation Matrix",
         mar = c(0,0,1,0))

# Spearman correlation plot
corrplot(spearman_correlation,
         method = "color",
         type = "upper",
         order = "hclust",
         addCoef.col = "black",
         tl.col = "black",
         tl.srt = 45,
         number.cex = 0.7,
         title = "Spearman Correlation Matrix",
         mar = c(0,0,1,0))

correlation between Installs Vs Size

# Calculate Pearson correlation and perform the test
cor_test <- cor.test(data_final$Size, data_final$Installs, method = "pearson")

# Output the correlation coefficient and p-value
cor_test
## 
##  Pearson's product-moment correlation
## 
## data:  data_final$Size and data_final$Installs
## t = 4.0069, df = 9657, p-value = 6.198e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.02081430 0.06063426
## sample estimates:
##        cor 
## 0.04074046

According to the relational hypothesis testing: 1. Correlation Coefficient (cor):Pearson correlation coefficient is 0.0407. This indicates a very weak positive relationship between Size and Installs—meaning that as app size increases, installs slightly tend to increase as well, but the effect is minimal.

P-value): The p-value is 6.198e-05 (or 0.00006198), which is much smaller than the conventional significance level (e.g., 0.05). This low p-value means that we can reject the null hypothesis (that there is no correlation) and conclude that x and y are not independent.

Confidence Interval: The 95% confidence interval for the correlation coefficient is between 0.0208 and 0.0606. This range is quite narrow and close to zero, further confirming that while the relationship is significant, the strength of the correlation is very low.

Statistical Tests

Statistical test for Installs and Price

# Check for missing values and ensure no negative/zero values in log_Installs
#data_final <- data_final %>%
  #filter(!is.na(Installs), Installs > 0)  # Remove missing values and zeros in Installs

# Apply log transformation, adding 1 to avoid log(0)
#data_final$log_Installs <- log(data_final$Installs + 1)

# Ensure Price_Category has no missing values
#data_final <- data_final %>%
 #filter(!is.na(Price_Category))

#Perform t-test on log-transformed Installs by Price Category
#t_test_result <- t.test(log_Installs ~ Price_Category, data = data_final, var.equal = FALSE)

#Print t-test results
#print(t_test_result)

There is a statistically significant difference between the number of installs for “Free” and “Paid” apps, with the p-value being extremely small.

From the above analysis, we can practically state that free apps are more popular than paid apps, which can be considered true in the app market.

T-Test for Reviews and Price

#Confirming with a t-test
# Perform t-test for Reviews between Free and Paid

t_test_reviews <- t.test(Reviews ~ Price_Category, data = data_duplicate)

# Perform t-test for Rating between Free and Paid
t_test_rating <- t.test(Rating ~ Price_Category, data = data_duplicate)

# Print the results
print(t_test_reviews)
## 
##  Welch Two Sample t-test
## 
## data:  Reviews by Price_Category
## t = 11.019, df = 9299.1, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group Free and group Paid is not equal to 0
## 95 percent confidence interval:
##  185401.3 265636.3
## sample estimates:
## mean in group Free mean in group Paid 
##         234243.689           8724.888
print(t_test_rating)
## 
##  Welch Two Sample t-test
## 
## data:  Rating by Price_Category
## t = -3.9443, df = 883.57, p-value = 8.638e-05
## alternative hypothesis: true difference in means between group Free and group Paid is not equal to 0
## 95 percent confidence interval:
##  -0.1121028 -0.0376075
## sample estimates:
## mean in group Free mean in group Paid 
##           4.167384           4.242239
  • There is a statistically significant difference between the mean number of reviews for Free and Paid apps. Free apps have significantly more reviews on average.

  • There is a statistically significant difference between the mean ratings for Free and Paid apps. Paid apps have slightly higher ratings on average, though the difference is small.

ANOVA Test for Reviews vs Ratings

The tests below are to test whether or not different review categories have different average ratings.

anova_result <- aov(Rating ~ as.factor(Review_Category), data = data_final)
summary(anova_result)
##                              Df Sum Sq Mean Sq F value Pr(>F)    
## as.factor(Review_Category)   11  106.3   9.662   41.36 <2e-16 ***
## Residuals                  9647 2253.6   0.234                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

According to p-value, it is significant hence we can say that the average rating for all review categories is not same.

Post Hoc Test

# Perform Tukey's HSD
tukey_result <- TukeyHSD(anova_result)
tukey_result
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Rating ~ as.factor(Review_Category), data = data_final)
## 
## $`as.factor(Review_Category)`
##                     diff          lwr         upr     p adj
## 100+-0+     -0.096683215 -0.152307271 -0.04105916 0.0000009
## 500+-0+     -0.063032835 -0.141474646  0.01540898 0.2646281
## 1K+-0+      -0.019190832 -0.089971134  0.05158947 0.9992526
## 2.5K+-0+     0.003350463 -0.074143085  0.08084401 1.0000000
## 5K+-0+       0.064918154 -0.012646893  0.14248320 0.2087515
## 10K+-0+      0.095614797  0.030638525  0.16059107 0.0000973
## 25K+-0+      0.105627098  0.035846939  0.17540726 0.0000488
## 50K+-0+      0.167554014  0.091642554  0.24346547 0.0000000
## 100K+-0+     0.203608898  0.135724795  0.27149300 0.0000000
## 300K+-0+     0.249388670  0.170111342  0.32866600 0.0000000
## 1M+-0+       0.300139945  0.211244127  0.38903576 0.0000000
## 500+-100+    0.033650380 -0.054364565  0.12166533 0.9848292
## 1K+-100+     0.077492383 -0.003768703  0.15875347 0.0784345
## 2.5K+-100+   0.100033678  0.012862795  0.18720456 0.0096675
## 5K+-100+     0.161601369  0.074366918  0.24883582 0.0000001
## 10K+-100+    0.192298012  0.116039053  0.26855697 0.0000000
## 25K+-100+    0.202310313  0.121918874  0.28270175 0.0000000
## 50K+-100+    0.264237229  0.178469737  0.35000472 0.0000000
## 100K+-100+   0.300292113  0.221540831  0.37904339 0.0000000
## 300K+-100+   0.346071885  0.257311491  0.43483228 0.0000000
## 1M+-100+     0.396823160  0.299375844  0.49427048 0.0000000
## 1K+-500+     0.043842003 -0.054455739  0.14213974 0.9515761
## 2.5K+-500+   0.066383298 -0.036853541  0.16962014 0.6214468
## 5K+-500+     0.127950989  0.024660470  0.23124151 0.0030189
## 10K+-500+    0.158647632  0.064443010  0.25285225 0.0000025
## 25K+-500+    0.168659933  0.071079887  0.26623998 0.0000011
## 50K+-500+    0.230586849  0.128532233  0.33264146 0.0000000
## 100K+-500+   0.266641733  0.170408442  0.36287502 0.0000000
## 300K+-500+   0.312421505  0.207839051  0.41700396 0.0000000
## 1M+-500+     0.363172780  0.251123410  0.47522215 0.0000000
## 2.5K+-1K+    0.022541295 -0.075001405  0.12008400 0.9998394
## 5K+-1K+      0.084108986 -0.013490527  0.18170850 0.1727899
## 10K+-1K+     0.114805629  0.026878134  0.20273312 0.0012014
## 25K+-1K+     0.124817930  0.033283243  0.21635262 0.0005180
## 50K+-1K+     0.186744846  0.090454254  0.28303544 0.0000000
## 100K+-1K+    0.222799730  0.132702117  0.31289734 0.0000000
## 300K+-1K+    0.268579502  0.169613735  0.36754527 0.0000000
## 1M+-1K+      0.319330777  0.212504774  0.42615678 0.0000000
## 5K+-2.5K+    0.061567691 -0.041004546  0.16413993 0.7193424
## 10K+-2.5K+   0.092264334 -0.001152170  0.18568084 0.0565429
## 25K+-2.5K+   0.102276635  0.005457227  0.19909604 0.0276896
## 50K+-2.5K+   0.164203551  0.062875978  0.26553112 0.0000078
## 100K+-2.5K+  0.200258435  0.104796512  0.29572036 0.0000000
## 300K+-2.5K+  0.246038206  0.142165102  0.34991131 0.0000000
## 1M+-2.5K+    0.296789482  0.185401898  0.40817707 0.0000000
## 10K+-5K+     0.030696643 -0.062779181  0.12417247 0.9957463
## 25K+-5K+     0.040708944 -0.056167701  0.13758559 0.9685508
## 50K+-5K+     0.102635860  0.001253596  0.20401812 0.0440982
## 100K+-5K+    0.138690744  0.043170771  0.23421072 0.0001331
## 300K+-5K+    0.184470516  0.080544059  0.28839697 0.0000004
## 1M+-5K+      0.235221791  0.123784453  0.34665913 0.0000000
## 25K+-10K+    0.010012302 -0.077112114  0.09713672 0.9999999
## 50K+-10K+    0.071939217 -0.020169104  0.16404754 0.3070668
## 100K+-10K+   0.107994101  0.022380758  0.19360745 0.0022235
## 300K+-10K+   0.153773873  0.058872409  0.24867534 0.0000078
## 1M+-10K+     0.204525148  0.101453039  0.30759726 0.0000000
## 50K+-25K+    0.061926916 -0.033630908  0.15748474 0.6094814
## 100K+-25K+   0.097981800  0.008667751  0.18729585 0.0175649
## 300K+-25K+   0.143761571  0.045508620  0.24201452 0.0001113
## 1M+-25K+     0.194512847  0.088346871  0.30067882 0.0000001
## 100K+-50K+   0.036054884 -0.058127272  0.13023704 0.9846717
## 300K+-50K+   0.081834656 -0.020863551  0.18453286 0.2768896
## 1M+-50K+     0.132585931  0.022293168  0.24287869 0.0048805
## 300K+-100K+  0.045779772 -0.051135776  0.14269532 0.9282456
## 1M+-100K+    0.096531047 -0.008398431  0.20146052 0.1064662
## 1M+-300K+    0.050751275 -0.061884591  0.16338714 0.9479902
# Convert the result to a data frame
tukey_df <- as.data.frame(tukey_result$`as.factor(Review_Category)`)

# Filter for significant p-values
significant_tukey <- tukey_df[tukey_df[4] < 0.05, ]

# Display the significant results
print(significant_tukey)
##                    diff          lwr         upr        p adj
## 100+-0+     -0.09668322 -0.152307271 -0.04105916 8.987756e-07
## 10K+-0+      0.09561480  0.030638525  0.16059107 9.732720e-05
## 25K+-0+      0.10562710  0.035846939  0.17540726 4.884843e-05
## 50K+-0+      0.16755401  0.091642554  0.24346547 0.000000e+00
## 100K+-0+     0.20360890  0.135724795  0.27149300 0.000000e+00
## 300K+-0+     0.24938867  0.170111342  0.32866600 0.000000e+00
## 1M+-0+       0.30013994  0.211244127  0.38903576 0.000000e+00
## 2.5K+-100+   0.10003368  0.012862795  0.18720456 9.667490e-03
## 5K+-100+     0.16160137  0.074366918  0.24883582 9.538328e-08
## 10K+-100+    0.19229801  0.116039053  0.26855697 0.000000e+00
## 25K+-100+    0.20231031  0.121918874  0.28270175 0.000000e+00
## 50K+-100+    0.26423723  0.178469737  0.35000472 0.000000e+00
## 100K+-100+   0.30029211  0.221540831  0.37904339 0.000000e+00
## 300K+-100+   0.34607188  0.257311491  0.43483228 0.000000e+00
## 1M+-100+     0.39682316  0.299375844  0.49427048 0.000000e+00
## 5K+-500+     0.12795099  0.024660470  0.23124151 3.018884e-03
## 10K+-500+    0.15864763  0.064443010  0.25285225 2.473396e-06
## 25K+-500+    0.16865993  0.071079887  0.26623998 1.080775e-06
## 50K+-500+    0.23058685  0.128532233  0.33264146 0.000000e+00
## 100K+-500+   0.26664173  0.170408442  0.36287502 0.000000e+00
## 300K+-500+   0.31242150  0.207839051  0.41700396 0.000000e+00
## 1M+-500+     0.36317278  0.251123410  0.47522215 0.000000e+00
## 10K+-1K+     0.11480563  0.026878134  0.20273312 1.201416e-03
## 25K+-1K+     0.12481793  0.033283243  0.21635262 5.179950e-04
## 50K+-1K+     0.18674485  0.090454254  0.28303544 1.572425e-08
## 100K+-1K+    0.22279973  0.132702117  0.31289734 0.000000e+00
## 300K+-1K+    0.26857950  0.169613735  0.36754527 0.000000e+00
## 1M+-1K+      0.31933078  0.212504774  0.42615678 0.000000e+00
## 25K+-2.5K+   0.10227664  0.005457227  0.19909604 2.768961e-02
## 50K+-2.5K+   0.16420355  0.062875978  0.26553112 7.808701e-06
## 100K+-2.5K+  0.20025843  0.104796512  0.29572036 3.507883e-10
## 300K+-2.5K+  0.24603821  0.142165102  0.34991131 0.000000e+00
## 1M+-2.5K+    0.29678948  0.185401898  0.40817707 0.000000e+00
## 50K+-5K+     0.10263586  0.001253596  0.20401812 4.409823e-02
## 100K+-5K+    0.13869074  0.043170771  0.23421072 1.331239e-04
## 300K+-5K+    0.18447052  0.080544059  0.28839697 4.428778e-07
## 1M+-5K+      0.23522179  0.123784453  0.34665913 2.244942e-10
## 100K+-10K+   0.10799410  0.022380758  0.19360745 2.223466e-03
## 300K+-10K+   0.15377387  0.058872409  0.24867534 7.832139e-06
## 1M+-10K+     0.20452515  0.101453039  0.30759726 5.942656e-09
## 100K+-25K+   0.09798180  0.008667751  0.18729585 1.756493e-02
## 300K+-25K+   0.14376157  0.045508620  0.24201452 1.113055e-04
## 1M+-25K+     0.19451285  0.088346871  0.30067882 1.436204e-07
## 1M+-50K+     0.13258593  0.022293168  0.24287869 4.880458e-03

As we can see, the significant difference for average rating for different review categories is between 0+ and 1M+ as expected.

For easier Ratings and Reviews vs Installs we can group Installs into categories given

ANOVA test for Content Rating vs Installs

# 1. Encode content rating (e.g., as factor levels or one-hot encoding)
data_final$Content.Rating <- as.factor(data_final$Content.Rating)

data_final <- data_final %>%
  filter(!is.na(Installs) & Installs > 0)

# ANOVA test for difference in installs between content ratings
install_anova <- aov(log10(Installs) ~ Content.Rating, data = data_final)

print("\nANOVA test results for Installs by Content Rating:")
## [1] "\nANOVA test results for Installs by Content Rating:"
print(summary(install_anova))
##                  Df Sum Sq Mean Sq F value Pr(>F)    
## Content.Rating    5    743  148.68   41.95 <2e-16 ***
## Residuals      9638  34160    3.54                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ANOVA analysis : Revealed significant differences in install counts based on content rating (F(5, 9638) = 41.95, p < 2e-16). This indicates that various content ratings have a substantial impact on the number of installs, highlighting the importance of content quality and type in attracting users.

As seen installs has the highest correlation with the reviews.

As we can see from the both pearson and spearman have relatively different correlation matrices and plots. We can refer to the categorical variables correlation from the spearman.

As seen reviews has the highest correlation(positive) with the installs and then in spearman correlation matrix it has high correlation(positive) with content rating and android version meaning

Rating is not much correlated with any of the variables, only slightly positively correlated with reviews and installs which was also demonstrated through visualisation previously.

Price vs. Log_Installs: -0.06, suggesting a very weak negative relationship between price and the number of installs.

Correlation Analysis: A moderate negative correlation :(ρ=−0.3317) was found between the number of days since the last update and the log-transformed installs. This indicates that as the time since the last update increases, the number of installs tends to decrease. The relationship is statistically significant (p < 2.2e-16), suggesting that timely updates may be crucial for maintaining user engagement.

Implications These findings suggest that regular updates are important for sustaining app installs, and that different content ratings can influence user engagement. Strategies aimed at timely updates and optimizing content ratings could enhance app performance and user acquisition.

# Load necessary libraries
library(ggplot2)
library(reshape2)

# Calculate the correlation matrix for Size and Installs
cor_matrix <- cor(data_final[, c("Size", "Installs")], use = "complete.obs", method = "pearson")

# Melt the correlation matrix for easy plotting with ggplot2
melted_cor_matrix <- melt(cor_matrix)

# Plot the heatmap
ggplot(data = melted_cor_matrix, aes(x = Var1, y = Var2, fill = value)) +
  geom_tile(color = "white") +
  scale_fill_gradient2(low = "blue", high = "red", mid = "white", 
                       midpoint = 0, limit = c(-1,1), space = "Lab", 
                       name="Pearson\nCorrelation") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, 
                                   size = 12, hjust = 1)) +
  ggtitle("Correlation Heatmap: Size vs Installs") +
  labs(x = "Variables", y = "Variables")